struct Library * library LONG funcOffset APTR newFunction
LOCATION
In SysBase at offset 70
FUNCTION
Replaces a certain jumptable entry with another one. This function only
Forbid()s taskswitching but doesn't Disable() interrupts. You have
to do your own arbitration for functions which are callable from
interrupts.
INPUTS
library
Pointer to library structure.
funcOffset
Offset of the jumpvector from the library base address in
bytes.
newFunction
New jumptable entry (pointer to the new function).
RESULT
Old jumptable entry (pointer to the old function).
NOTES
While it's more or less safe to patch a library vector with
SetFunction() it's not possible to safely remove the patch later.
So don't use this function if it can be avoided.
EXAMPLE
BUGS
On native builds, this contains a hack to fix dos.library/ramlib
attempts to setfunction exec functions. Because of this, a funcOffset
of more than 32 kB be truncated. This hack will also fix other programs
only using the lower 16 bits of funcOffset and leaving garbage in the
upper 16 bits. These programs should be fixed.